package com.js.myapp.system.activity;

import android.os.Bundle;

import androidx.annotation.LayoutRes;

import com.js.basicutils.ToastUtils;
import com.trello.rxlifecycle2.components.support.RxAppCompatActivity;


public abstract class BaseActivity extends RxAppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        if (getLayoutId() != 0) {
            setContentView(getLayoutId());
        }
        init(savedInstanceState);
    }
    protected void showToast(String msg) {
        ToastUtils.showToast(this, msg);
    }

    protected abstract @LayoutRes int getLayoutId();

    protected abstract void init(Bundle savedInstanceState);
}
